<template>
    <div>
        <van-tabbar v-model="active" active-color="#ee0a24" @change="changeIcon">
            <van-tabbar-item >
                <van-icon name="chat-o" class-prefix="iconfont icon-shouye" slot="icon" size="1.2rem"/>
                <span>首页</span>
            </van-tabbar-item>
            <van-tabbar-item >
                <van-icon name="chat-o" class-prefix="iconfont icon-xinigejuyuan" slot="icon" size="1.2rem"/>
                <span>剧院</span>
            </van-tabbar-item>
            <van-tabbar-item >
                <van-icon name="chat-o" class-prefix="iconfont icon-qianbao" slot="icon" size="1.2rem"/>
                <span>票夹</span>
            </van-tabbar-item>
            <van-tabbar-item >
                <van-icon name="chat-o" class-prefix="iconfont icon-wode" slot="icon" size="1.2rem"/>
                <span>我的</span>
            </van-tabbar-item>
        </van-tabbar>
    </div>
</template>
<script>
import '@/assets/font/iconfont.css'
import Vue from 'vue';
import { Tabbar, TabbarItem , Icon} from 'vant';

Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Icon);
export default {
    data () {
        return {
            active:0,
            urls:['/home','/theater','/wallet','/center']
        }
    },
    created () {
      this.active = this.urls.indexOf(this.$route.path)
    },
    methods: {
        changeIcon(index){
            // console.log(index);
            this.$router.push(this.urls[index])
        }
    }
}
</script>